#include <iostream>
#include <cmath>
using namespace std;
class Qiugen
{
 public:
 double a,b,c,delta,x1,x2,i,R;
 void input()
 {
    cout<<"ax^2+bx+c，请分别输入a、b、c"<<endl;
    cin>>a>>b>>c;
    delta=b*b-4*a*c;
 }
 void panduan()
 {
     if (delta>=0)
      {
       x1=(-b+sqrt(delta))/(2*a);
       x2=(-b-sqrt(delta))/(2*a);
       cout<<"x1="<<x1<<",x2="<<x2<<endl;
      }
     else
      {
       i=(sqrt(-delta))/(2*a);
       R=(-b)/(2*a);
       cout<<"x1="<<R<<"+"<<i<<"i,"<<"x2="<<R<<"-"<<i<<"i"<<endl;
      }
 }
};
int main()
{
 Qiugen qiugen;
 qiugen.input();
 qiugen.panduan();
 return 0;
}